﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WRJ
{
	public partial class BaseForm : Form
	{
		public BaseForm()
		{
			InitializeComponent();

			this.MaximizeBox = false;
			this.MinimizeBox = false;
			
		}
		
		/// <summary>
		/// 重写WndProc方法，禁用拖动标题栏和双击标题栏的事件
		/// </summary>
		/// <param name="m"></param>
		protected override void WndProc(ref Message m)
		{
			base.WndProc(ref m);
			if (m.Msg == 0x84)     //不让拖动标题栏 
			{
				if ((IntPtr)2 == m.Result)
					m.Result = (IntPtr)1;
			}
			if (m.Msg == 0x00A3)       //双击标题栏无反应 
				m.WParam = System.IntPtr.Zero;
		}
		
		
	}
}
